package com.chushouya.controller.product.admin;

import com.chushouya.common.constant.ServiceType;
import com.general.framework.core.schema.Response;
import com.chushouya.product.dto.admin.product.ProductAttrVO;
import com.chushouya.product.service.admin.ProductAttrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = ServiceType.PLATFORM + "商品属性管理")
@RestController
@RequestMapping(ServiceType.PLATFORM + "/productAttr")
public class ProductAttrController {

    @Resource
    private ProductAttrService productAttrService;

    @ApiOperation("获取商品属性列表")
    @GetMapping("/list")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productId", value = "商品ID", required = true)
    })
    public Response<List<ProductAttrVO>> list(Long productId) {
        List<ProductAttrVO> list = productAttrService.selectProductAttr(productId);
        return Response.success(list);
    }
}
